public class J3zizeng {
    public static void main(String[] args) {
        int age = 2;
//        age = age + 1;
//        age += 1;
        //只针对变量，自增1
//        age++; // age += 1
//        age++;
//        ++age;
        age--;
        --age;
        System.out.println("age = " + age);
    }
}
class J3zizeng2{
    public static void main(String[] args) {
        /**
         * ++后置，先参与运算，再自增
         * ++前置，先自增，再参与运算
         */
        int age = 3;
//        int num = age++;
        int num = ++age;

        System.out.println("num = " + num);//3 4
        System.out.println("age = " + age);//4 4
        System.out.println("=====");
        int a = 6;
//        int b = --a;
        int b = a--;
        System.out.println("b = " + b);//5  6
        System.out.println("a = " + a);//5  5
    }
}
class J3demo{
    public static void main(String[] args) {
        int a = 10;
        int b = 10;
        int c = ++a;
        int d = b++;
        System.out.println(c);//c = 11
        System.out.println(d);//d = 10
        //a=11   b=11
        int e = (c++)*2 + (++d) % 5;
//        int e = 11*2 + 11 % 5;
//        int e = 22 + 1;

        System.out.println(e);//23
    }
}